<!-- announcementAdd -->
<?
include_once "settings.inc.php";
global $DB, $sess, $_SESSION;
?>
<style>
	label		{	font-family:Tahoma; font-size:12px; font-weight:bold; text-align:right;	}
	textarea {	position:relative; min-height:50px; background:#fff;	}
	.etiket	{	width:150px; min-height:30px; line-height:30px;	}
</style>

<script>
	$(function() {
		$( ".datetime" ).datepicker( {regional : "tr"} );

		$(".geri").click(function(){
			history.back(1);
		});
	});
	
	
</script>
<h2>ÜRÜN EKLE</h2>
<form method="post" action="?<?=_MODULE_NAME?>.addProcess" method="POST" enctype="multipart/form-data" >
	<fieldset>
		<!-- <legend>Duyuru Ekleme</legend> -->
		<input type="hidden" name="userId" id="userId" value="1" />
		<table cellpadding="0" cellspacing="3" border="0" style="width:100%;">
			<tr>
				<td class="right etiket"><label for="category_namex">Üst Kategori Adı : </label></td>
				<td>
					<select name="category_id" id="category_id">
						<?
							function subCategoryList($parentId, $symbol)
							{
								global $DB;
								$sym.=$symbol;
								$sql="SELECT * FROM "._MODULE_NAME."Category WHERE parent=$parentId ORDER BY row ASC";
								$categorys = $DB->fetchArray($sql);
								if(is_array($categorys[0]))
								{
									foreach($categorys as $cat)
									{
										if($selected == $cat['id'])
										echo '<option value="'.$cat['id'].'" selected="selected">'.$sym.$cat['category_name'].'</option>';
										else
										echo '<option value="'.$cat['id'].'">'.$sym.$cat['category_name'].'</option>';
										subCategoryList($cat['id'],$sym." &rarr; ",$selected);
									}
								}
							}
							subCategoryList(0," ");
						?>
					</select>
				</td>
			</tr>
			<tr>
				<td class="right etiket"><label for="product_namex">Ürün Adı : </label></td>
				<td><input class="mf" name="product_name" id="product_namex" type="text" value="" /></td>
			</tr>
			<tr>
				<td class="right etiket"><label for="materialsx">Malzeme : </label></td>
				<td><textarea name="materials" id="materialsx"></textarea></td>
			</tr>
			<tr>
				<td class="right etiket"><label for="quantityx">Miktar : </label></td>
				<td><input class="mf" name="quantity" id="quantityx" type="text" value="" /></td>
			</tr>
			<tr>
				<td class="right etiket"><label for="contentx">Açıklama : </label></td>
				<td><textarea name="content" id="contentx"></textarea></td>
			</tr>
			<tr>
				<td class="right etiket"><label for="picture">Resim: </label></td>
				<td><input type="file" name="picture" id="picture" /></td>
			</tr>
			<tr>
				<td class="etiket">&nbsp;</td>
				<td class="left">
					<input class="button" type="submit" value="Kaydet" />
					<input class="button geri" type="button" value="Geri" />
				</td>
			</tr>
		</table>
	</fieldset>
</form>
<!-- /announcementAdd -->		